{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-3.4.1/css/bootstrap.min.css' %}">
    <style>
        .login-box {
            width: 400px;
            border: 1px solid #aaa;
            padding: 30px;
            margin-top: 150px;
            border-radius: 5px;
            box-shadow: 5px 5px 5px #aaa;
        }
    </style>
</head>
<body>
<form method="post" novalidate>
    {% csrf_token %}
    <div class="login-box col-xs-offset-5" style="">
        <h3 style="text-align:center;">用户登录</h3>
        <div class="form-group">
            <label for="exampleInputEmail1">用户名</label>
            {{ form.username }}
            <span style="color: red;"> {{ form.username.errors.0 }}</span>
        </div>
        <div class="form-group">
            <label for="exampleInputPassword1">密码</label>
            {{ form.password }}
            <span style="color: red">    {{ form.password.errors.0 }} </span>
        </div>
        <div class="form-group">
            <label for="id_code">{{ form.code.label }}</label>
            <div class="row">
                <div class="col-xs-7">
                    <!-- <input type="text" name="code" class="form-control" placeholder="请输入" >  -->
                    {{ form.code }}
                    <span style="color: red">{{ form.code.errors.0 }}</span>
                </div>
                <div class="cos-xs-5">
                    <img id="imge_code" src="/img/code/">
                </div>
            </div>
        </div>
        <button type="submit" class="btn btn-success">登录</button>
    </div>
</form>
<script src="{% static  'js/jquery-3.5.1.js' %}"></script>
<script>
    $(function () {
        imgsrc();
    })

    function imgsrc() {
         $("#imge_code").click(function () {
            location.reload();
        })
    }

</script>
</body>
</html>